Despite the gains, Wall Street was set for its worst month since May after escalations in US-China trade tensions and fears of a risk of recessions, underscored by the inversion of a key part of the US yield curve, triggered bouts of selloff in August.
Markets were higher earlier in the day after data showed strong US consumer spending in July and on signals that Washington and Beijing would resume trade talks.
With analysts saying investors were taking money off the table ahead of the holiday, by midday only the Dow Jones Industrial Average was clearly in positive territory.
"Frankly, markets have been overly optimistic about trade," said Randy Frederick, vice president of trading and derivatives for Charles Schwab in Austin.
Markets are also bracing for a new round of US tariffs on some Chinese goods that come into effect on Sunday and the technology sector was the biggest weight on the S&P with a 0.3% loss.
Ulta Beauty Inc tumbled 28.8%, to the bottom of the S&P 500, after the cosmetics company cut its full-year profit forecast.
At 01:09 p.m. ET, the Dow Jones Industrial Average was up 41.07 points, or 0.16%, at 26,403.32, the S&P 500 was up 0.44 points, or 0.02%, at 2,925.02. The Nasdaq Composite was down 29.77 points, or 0.37%, at 7,943.62.
Hopes that the Federal Reserve would step in to arrest any slowdown in economic growth as a result of the trade war have led traders to fully price in an interest rate cut at the next meeting of the US central bank in mid-September.
The biggest gainer on the benchmark index was Campbell Soup Co, which jumped 7.80% after its quarterly profit beat estimates.